package cn.kxhp.mybatis3.dao.mapper.base;

import cn.kxhp.mybatis3.entity.Role;
import org.apache.ibatis.annotations.*;

/**
 * @author Lianxw
 * @since 2022/3/29
 */
@Mapper
public interface RoleMapper {

    @Results(id = "roleBaseResultMap", value = {
            @Result(column = "id", property = "id", id = true),
            @Result(column = "code", property = "code"),
            @Result(column = "title", property = "title"),
            @Result(column = "status", property = "status"),
            @Result(column = "app_id", property = "appId"),
            @Result(column = "created_at", property = "createdAt"),
            @Result(column = "updated_at", property = "updatedAt")
    })
    @Select("select r.id, r.code, r.title, r.status, r.app_id, r.created_at, r.updated_at " +
            "from infra_role AS r " +
            "where r.id=#{id}")
    Role selectById(@Param("id") Long id);

}
